#!/bin/sh
LUAC=./3rd/lua/luac
rm ./bin/* -rf
mkdir -p bin
cp ./gameser/* ./bin/ -rf

Luas=`find ./gameser -name "*.lua"`
for file in $Luas
do
    filename=$file
    luacname=${filename/gameser/bin}
    newlua=${filename/gameser/bin}
    $LUAC -o $luacname $newlua
done

sed -i 's/shortpath=\"gameser\"/shortpath=\"bin\"/g' ./bin/common/config.path

dst=`date "+%Y%m%d%H%M%S"`

sed -i "s/build=.*[0-9]/build=$dst/g" ./bin/version
